package com.kinghunt.misp.dal.dao.userx;

import com.kinghunt.misp.dal.model.userx.UserDO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* 用户
* Created by Mybatis Generator on 2023/07/04
*/
public interface UserDAO {
    int deleteByPrimaryKey(Long id);

    int insert(UserDO record);

    int insertSelective(UserDO record);

    UserDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserDO record);

    int updateByPrimaryKey(UserDO record);

    int addUser(UserDO userDO);

    UserDO getUserByUsername(@Param("username") String username);

    UserDO getUserByUsernameAndOrgId(@Param("username") String username, @Param("orgId") Long orgId);

    UserDO getUserByOpenIdAndOrgId(@Param("openId") String openId, @Param("orgId") Long orgId);

    UserDO getUserByPhoneAndOrgId(@Param("phone") String phone, @Param("orgId") Long orgId);

    //int updateUserInfo(UserDO userDO);

    int updatePassword(@Param("encryptPassword") String encryptPassword,
                       @Param("userId") long userId);

    List<UserDO> getUserByIds(@Param("list") List<Long> userIds);

    List<UserDO> pageByUsernameAndOrgId(@Param("username") String username,
                                        @Param("orgId") Long orgId,
                                        @Param("offset") int offset,
                                        @Param("size") int size);

    int countByUsernameAndOrgId(@Param("username") String username, @Param("orgId") Long orgId);

    UserDO getUserByMobilePhone(@Param("mobilePhone") String mobilePhone);

    int updateUsername(@Param("username") String username, @Param("userId") long userId);

    UserDO selectByOpenId(@Param("openId") String openId);

    List<UserDO> selectByOrgIAndRoleId(@Param("orgId") Long orgId, @Param("roleId") Long roleId);
}